<?php 
namespace Index\Model;
use Think\Model;
/**
 * 用户表模型
 */
class UserModel extends Model {
	
	public function checkEamil($email)
	{

		$res = M('user')->where("email='$email'")->find();
		// var_dump(M('user'));
		if($res){
			ReAjax(1,'邮箱已存在');
		}
	}

	public function checkNickname($nickname)
	{

		$res = M('user')->where("nickname='$nickname'")->find();
		// var_dump(M('user'));
		if($res){
			ReAjax(1,'昵称已经存在');
		}
	}
	public function hotuser($value='')
	{

		if(S('hotuser')){

			echo "7777";
			return S('hotuser');
		}else{

			echo "8888";

			$data = $this->field('id,face,nickname,answer_num')->order('answer_num desc')->limit(12)->select();


			S('hotuser',$data,60);


			return $data;

		}
		
	} 
	
}

 ?>